<template>
  <div>
    <h1>理财信息列表显示页面</h1>
    项目名称:<input type="text" v-model="showData.MonMoneyName">
    <button @click="ShowList">查询</button>
  </div>
  
  <div>
    <table>
      <tr>
        <td>项目名称</td>
        <td>年收益</td>
        <td>月收益</td>
        <td>最低金额</td>
        <td>理财人数</td>
        <td>风险等级</td>
        <td>操作列</td>
      </tr>

      <tr v-for="item in list" :Key="data.MonMoneyId">
        <td>{{  }}</td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
      </tr>
    </table>
  </div>
  
</template>

<script setup lang="ts">

import router from '@/router';
import axios from 'axios';

import {reactive,toRefs,onMounted} from 'vue'

let data=reactive({
  list:[],
  showData:{
    MonMoneyName:'',
  },
  MonMoneyId:''
})

let {list,showData,MonMoneyId}=toRefs(data)

onMounted(()=>{
  ShowList()
})

const ShowList=()=>{
  axios({
    url:'http://localhost:51439/api/MonMoney/GetShowMonMoney',
    method:'get',
    params:{
      MonMoneyName:showData.value.MonMoneyName,
    }
  }).then(res=>{
    list.value=res.data
    console.log(list.value);
  }).catch(err=>{
    console.log(err);  
  })
}

</script>

<style scoped>

</style>